package com.san.common.utils;

import java.util.Comparator;

import com.san.oms.domain.QuotaRuleDTO;

public class QuotaRuleComparator implements Comparator<Object> {

	@Override
	public int compare(Object arg0, Object arg1) {
		if (null != arg0 && null != arg1) {
			QuotaRuleDTO dto0 = (QuotaRuleDTO)arg0;
			QuotaRuleDTO dto1 = (QuotaRuleDTO)arg1;
			
			if(dto0.getNum() > dto1.getNum()) {
				return 1;
			} else if (dto0.getNum() < dto1.getNum()){
				return -1;
			} else {
				return 0;
			}
			
		}
		return 0;
	}

}
